<?php
session_start();
include "Includes/solotrn_sesion.php";
include "Includes/soloFun_Generales.php";

$id_tecnico = $_REQUEST["id_tecnico"];
$CboNodo = $_REQUEST["CboNodo"];
$TopNodo = 1;
if ($CboNodo == "") $CboNodo = $TopNodo;	//'si es blanco le asigno el primer valor
$strsql = "select * from solotb_nivel1";
SoloFun_ExecSql2 ($strsql, $SoloArrNodos);
$StrCboNodo = SoloFun_CargaCombo($SoloArrNodos,"CboNodo","$CboDisabled",$CboNodo," class='SoloStyle_Texto' style='width:200'","");

$CboDepartamento = $_REQUEST["CboDepartamento"];
$strsql = "SELECT id2, des FROM solotb_nivel2 WHERE id1 = $CboNodo";
SoloFun_ExecSql2 ($strsql, $arrDepartamentos);
$strCboDepartamento = SoloFun_CargaCombo($arrDepartamentos,"CboDepartamento","",$CboDepartamento," class='SoloStyle_Texto' style='width:200'","");

$CboUsuario = $_REQUEST["CboUsuario"];
$strsql = "SELECT nu_usua, no_usua FROM solotb_usuario WHERE nodo = $CboNodo ORDER BY no_usua";
SoloFun_ExecSql2 ($strsql, $arrUsuarios);
$strCboUsuario = SoloFun_CargaCombo($arrUsuarios,"CboUsuario","",$CboUsuario," class='SoloStyle_Texto' style='width:200'","");

$valida = "ValidaDatos()";
//$valida = "";
$opcion = $_REQUEST["Opcion"];
$usu = $_REQUEST["usuario"];
switch ($opcion) {
    case 1:
        $imagen = "iconos/soloico_grabar.gif";
        $Titulo = "Modificar Funcionario";
        $Oculto = "<input type='hidden' name='Opcion' value=1>";
        break;
    case 2:
        $imagen = "iconos/soloico_eliminar.gif";
        $Titulo = "Eliminar Funcionario";
        $Oculto = "<input type='hidden' name='Opcion' value=2>";
        break;
    case 3:
        $imagen = "iconos/soloico_grabar.gif";
        $Titulo = "Ingresar Funcionario";
        $Oculto = "<input type='hidden' name='Opcion' value=3>";
        break;
}

//$soloSQL8 = "select nu_usua, no_usua from solotb_usuario where co_perf = (select valor from solotb_parametros where descripcion = 'Id Supervisor')";

//soloFun_ExecSQL ($soloSQL8,$SoloArradmin);
//$stradmin = SoloFun_CargaCombo1($SoloArradmin,"Cboadmin",$Cbodisabled10,$Cbomedida1," style='width: 185px' class='SoloStyle_Texto'");
?>
<html>
    <head>
        <title>MIES-WORKFLOW - Modificar T&eacute;cnicos</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <link rel="stylesheet" href="SoloStyles/Solostyles.css" type="text/css">
        <SCRIPT type="text/JavaScript" src="Includes/Solofun_generales.js"></SCRIPT>
    </head>
    <body topmargin="0" leftmargin="0" onkeydown="checkKey();">
        <table cellpadding="0" cellspacing="0" style="width: 90%">
            <tr>
                <td><img src="templates/SoloTemplate_LogoCabecera.png" style="height: 50px" alt=""/></td>
                <td style="text-align:center" class="SoloStyle_TituloPaginas"><?php echo $Titulo;?></td>
            </tr>
        </table><br>
        <form name="frm" action="solotrn_GrabarTecnico.php?usuario=<?php echo $usu;?>" method="POST">
            <?php echo $Oculto;?>
            <table border="0" width="90%" align="center" cellpadding="2" cellspacing="1" bordercolor="#CCCCCC">
                <tr>
                    <td>
                        <img src="iconos/soloico_salir.gif" border="1" alt="Regresar" style="cursor:hand" onClick="window.opener.location.reload(); window.close();" >
                        <img src="<?php echo $imagen;?>" border="1" alt="Grabar" style="cursor:hand" onClick="<?php echo $valida;?>;">
                    </td>
            </table>
            <table border="0" width="90%" bordercolor="#CCCCCC" cellpadding="2" cellspacing="1" align="center">
                <tr>
                    <td class="SoloStyle_Etiqueta">Subsecretar&iacute;a</td>
                    <td class="SoloStyle_EtiquetaCajas"><?php echo $StrCboNodo; ?></td>
                </tr>
                <tr>
                    <td class="SoloStyle_Etiqueta">Departamento</td>
                    <td class="SoloStyle_EtiquetaCajas"><?php echo $strCboDepartamento; ?></td>
                </tr>
                <tr>
                    <td class="SoloStyle_Etiqueta" width="25%"><b> Usuario</b></td>
                    <td class="SoloStyle_EtiquetaCajas" width="75%">
                        <?php echo $strCboUsuario; ?>
                        <input type="hidden" id="id_tecnico" name="id_tecnico" value="<?php echo $id_tecnico;?>">
                    </td>
                </tr>
            </table>
            <br>
        </form>
    </body>
</html>
<script type="text/javascript">
    function ValidaDatos(){
        /*if (document.getElementById("ATxtmail").value == ""){
            alert ("El campo es requerido");
            document.getElementById("ATxtmail").focus();
            return;
        }

        if (document.getElementById("ATxtUsuario").value == ""){
            alert ("El campo es requerido");
            document.getElementById("ATxtUsuario").focus();
            return;
        }

        if (document.getElementById("ATxtNombre").value == ""){
            msgbox ("El campo es requerido");
            document.getElementById("ATxtNombre").focus();
            return;
        }*/

        document.frm.submit();
    }

    function novalida(){
        document.frm.submit();
    }
</script>
<?php
include "Includes/soloFun_ShowMessages.php";
?>
